// components/tree/tree.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    treeData: {
      type: Array,
      value:[],
    },
    select: {
      type: Object,
      value:{},
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    height: {
      
    },
  },
  /**
   * 组件的方法列表
   */
  methods: {
    rowClick({currentTarget}) {
      let {height} = this.data;
      let id = currentTarget.dataset.id;
      if(height[id]) {
        height[id] =false;
      } else {
        height[id] =true;
      }
      this.setData({height})
    },
    checkboxClick({currentTarget}) {
      let id = currentTarget.dataset.id;
      this.triggerEvent('selectChange', id)
    },
    selectChange({detail}) {
      this.triggerEvent('selectChange', detail)
    }
  }
})
